package com.note.chh.notebook.Adapter;

import android.view.ViewGroup;
import android.widget.ImageView;

import com.blankj.utilcode.util.SizeUtils;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.note.chh.notebook.Model.BeautifulPictureModel;
import com.note.chh.notebook.R;

/**
 * Created by caihuahui on 2018/3/22.
 */

public class BeautifulPictureAdapter extends BaseQuickAdapter<BeautifulPictureModel.ResultsBean,BaseViewHolder>{
    public BeautifulPictureAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, BeautifulPictureModel.ResultsBean item) {
        ImageView mImage_buautiful = helper.getView(R.id.mImage_buautiful);
        Glide.with(mContext).load(item.getUrl()).into(mImage_buautiful);
        ViewGroup.LayoutParams params = mImage_buautiful.getLayoutParams();
        if (helper.getPosition()==1) {
            params.height = SizeUtils.dp2px(150);
        }else{
            params.height = SizeUtils.dp2px(200);
        }

    }
}
